package org.summerframework.component.security;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.collections4.CollectionUtils;

import java.util.List;

/**
 * @author 石超
 * @version v1.0.0
 */
@Getter
@Setter
public class AdminSave {
    private List<Long> ids;

    public AdminSave() {
    }

    public AdminSave(List<Long> ids) {
        this.ids = ids;
    }

    public boolean isAdmin(Long userId) {
        return CollectionUtils.isNotEmpty(ids) && ids.contains(userId);
    }
}
